package com.sky.mapper;

import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {
    void insert(Orders orders);
    @Select("select * from sky_take_out.orders where number = #{orderNumber}")
    Orders getByNumber(String outTradeNo);

    void update(Orders orders);
    @Select("select * from sky_take_out.orders where status=#{status} and order_time=#{orderTime}")
    List<Orders> getByStatusAndOrdertime(Integer status, LocalDateTime orderTime);
@Select("select * from sky_take_out.orders where id=#{id}")
    Orders getById(Long id);

    Double sumMap(Map map);

    Integer countByMap(Map map);
}
